﻿// Inner Fire 游戏引擎库
// Collision - 碰撞检查
//
// Copyright (c) 2025 by 尔西大帝. All rights reserved.
//
// 所属层级：应用层（4）
// 用于检查碰撞。
//
// Author: 尔西大帝
// Email: 2670613871@qq.com
// Created: 2025-06-24

#pragma once

#include <game/physics/rigid_body.h>
#include <game/physics/collider.h>
#include <game/physics/contact.h>

namespace ifire::game {

class Collision {
public:
  static bool IsColliding(RigidBody* a, RigidBody* b, Contact& c);

private:
  static bool IsCollidingSphereSphere(RigidBody* a, RigidBody* b, Contact& c);
  static bool IsCollidingBoxBox(RigidBody* a, RigidBody* b, Contact& c);
  static bool IsCollidingSphereBox(RigidBody* a, RigidBody* b, Contact& c);
  static bool IsCollidingSphereCapsule(RigidBody* a, RigidBody* b, Contact& c);
  static bool IsCollidingBoxCapsule(RigidBody* a, RigidBody* b, Contact& c);
  static bool IsCollidingCapsuleCapsule(RigidBody* a, RigidBody* b, Contact& c);
};
} // namespace ifire::game